<?
$page_title="Anti Virus Subscription - Request ";
if($_GET["mode"]==1) $page_title="Anti Virus Subscription - Registration "; 
$mindex=3;
?>
<? include("includes/header.php") ?>
<?
$_POST=$_SESSION["form-data"];
$event_info=@array_pop(qry_data("select * from bkit_product_subscriptions where rec_status>=1 "));
?>
<div class="break"></div>

<?if($_GET["mode"]==1) { ?>
<div class="msgBox">You have successfully registered your antivirus subscription .
</div>
<p> You will be notified whenever there are any updates.</p>
<p>Please contact <a href="mailto:m.irfan@mediatrendit.com">m.irfan@mediatrendit.com</a> if you have any queries.</p>
<? }else{ ?>
<p>This form will submit your request to get a copy of licensed NOD 32 Anti-Virus which is highly recommended by the Brahma Kumaris IT Team.
</p>
<?}?>


<?if($_GET["mode"]!=1) { ?>
<script src="registrant.js?v7" language="javascript"></script>
<script src="calendarDateInput.js" language="javascript"></script>
<script src="prototype.js" language="javascript"></script>


<form action="subscribeav_pro.php?>" method="post" id="frmRegister" onsubmit="return validateForm(this)" >
<div class="fright"><i>* Required fields</i></div>
<div class="break"></div>
  <table id="Regform" border="0" cellspacing="3" cellpadding="2" width="100%">

    <tbody>
	<tr><td colspan="2" class="section_head">Subscriber Information</td></tr>
	<tr>
	
        <td class="frmLabel">Subscriber Type *</td>

        <td>
          <input class="inputCheckbox" name="sub_from" id="rbSub_1" value="1" type="radio" checked="true"  onchange="toggleForm(this.checked,1)"/>
	<label for="rbSub_1">BK Centre</label>
          <input class="inputCheckbox" name="sub_from" id="rbSub_2" value="2" type="radio" onchange="toggleForm(this.checked,2)"/>
	<label for="rbSub_2">BK Member</label>
        

        </td>

      </tr>
      
      <tr id="tr1">
        <td class="frmLabel">Centre Reg.No&nbsp;*</td>
        <td><input class="txtbox" name="centre_reg_id" id="centre_reg_id" size="40" value="<?=$_POST["centre_reg_id"]?>" type="text" /></td>
      </tr>
      <tr id="tr2">
        <td class="frmLabel">Centre Name&nbsp;*</td>
        <td><input class="txtbox" name="centre_name" id="centre_name" size="40" value="<?=$_POST["centre_name"]?>" type="text" /></td>
      </tr>     
        <tr  id="tr3">
        <td class="frmLabel">Centre Email&nbsp;*</td>
        <td><input class="txtbox" name="centre_email" id="centre_email" size="40" value="<?=$_POST["centre_email"]?>" type="text" /></td>
      </tr>  
      <tr>
        <td class="frmLabel">Contact Name&nbsp;*</td>
        <td><input class="txtbox" name="contact_name" id="contact_name" size="40" value="<?=$_POST["contact_name"]?>" type="text" /></td>
      </tr>  
      
      <tr  id="tr4" style="display:none"> 
        <td class="frmLabel">BKITC Membership ID &nbsp;*</td>
        <td><input class="txtbox" name="contact_reg_id" id="contact_reg_id" size="40" value="<?=$_POST["contact_reg_id"]?>" type="text" /> (starts with BKITC******)</td>
      </tr>  

      <tr  id="tr5" style="display:none"> 
        <td class="frmLabel">Contact Email&nbsp;*</td>
        <td><input class="txtbox" name="contact_email" id="contact_email" size="40" value="<?=$_POST["contact_email"]?>" type="text" /></td>
      </tr>  
        <tr>
        <td class="frmLabel"> Mobile No&nbsp;*</td>
        <td><input class="txtbox" name="contact_mobile" id="contact_mobile" size="40" value="<?=$_POST["contact_mobile"]?>" type="text" /></td>
      </tr>  
        <tr id="tr6">
        <td class="frmLabel" valign="top">Address&nbsp;*</td>
      	<td>  <textarea class="txtarea" rows="4" cols="50" name="contact_address" id="contact_address"><?=$_POST["contact_address"]?></textarea></td>
      </tr>  
      <tr><td colspan="2" class="section_head">Payment Information - (<span><a href="docs/EFT Request Form.doc" target="_blank">Download Payment Instructions</a></span>)</td></tr>
	
        <tr>
        <td class="frmLabel">No.of Subscription&nbsp;</td>
        <td><input class="txtbox" name="sub_count" id="sub_count" size="2" value="<?=$_POST["sub_count"]?>" type="text" onkeypress="return allowNumbersOnly(event)"/></td>
      </tr> 
      
        <tr>
        <td class="frmLabel">Amount Paid&nbsp;</td>
        <td><input class="txtbox" name="amount" id="amount" size="6"  value="<?=$_POST["amount"]?>" type="text"  onkeypress="return allowNumbersOnly(event)"/> INR</td>
      </tr> 
      <tr>
        <td class="frmLabel">Payment Date*</td>
        <td>
         <script language="javascript">
         <?if($_POST["pay_date"]==""){?>
         DateInput('pay_date', true, 'YYYY-MM-DD');
         <?} else { ?>

         DateInput('pay_date', true, 'YYYY-MM-DD','<?=$_POST["pay_date"]?>');

         <? } ?>
         
         </script>
        
        </td>
      </tr> 
   
      
         <tr>
        <td class="frmLabel"  valign="top">Payment Info</td>
       	<td>  <textarea class="txtarea" rows="2" cols="50" name="pay_remarks" id="pay_remarks"><?=$_POST["pay_remarks"]?></textarea></td>

      </tr> 
         <tr>
        <td class="frmLabel" valign="top">Other Info/Notes</td>
	<td>  <textarea class="txtarea" rows="2" cols="50" name="user_notes" id="user_notes"><?=$_POST["user_notes"]?></textarea></td>
      </tr> 

 	<tr>
        <td class="frmLabel" valign="top">Enter the Code seen below *
         <img src="images/refresh.jpg" onclick="refreshCaptcha()" style="border:1px solid #666;padding:3px;" title="click to change the code"><br/>
		<img src="render-captcha.php?rand=<?php echo rand(); ?>" id="captchaimg" style="margin:4px;border:1px solid #666;">

        </td>

        <td>
        	<a name="cap"></a>
        	<?if($_GET["mode"]==2) echo "<span class='errorBox'>Invalid code. Please check again.<br></span>" ?>
        	<input class="txtbox" name="captcha_code" id="captcha" size="6" size="4"></td>
	
      </tr> 



       

  	
    </tbody>
  </table>

&nbsp;
  <p align="center"><input value="Register Subscription" id="frmSubmit" name="submit" type="submit" class="button"/>  <input value=" Reset " 	name="reset" type="reset"  class="button"/></p>

</form>
<? } ?>

<script type="text/javascript">

function toggleForm(vState,vMode){

if(vState==true && vMode==1){

$("tr1").show();
$("tr2").show();
$("tr3").show();
$("tr6").show();
$("tr4").hide();
$("tr5").hide();


}
if(vState==true && vMode==2){


$("tr1").hide();
$("tr2").hide();
$("tr3").hide();
$("tr4").show();
$("tr5").show();
$("tr6").hide();

}


}
function validateForm(vFormObject){


	var validateEmail=true;
	var validatePhone=false;

	var msgPrefix=" ";
	var user_msg="";
	var emailfilter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i

	
	if(vFormObject.sub_from[0].checked){
	
		if(vFormObject.centre_reg_id.value=="")
		user_msg= user_msg + wrap(msgPrefix + "Centre Reg.No cannot be empty. Please check.");
		
		if(vFormObject.centre_name.value=="")
		user_msg= user_msg + wrap(msgPrefix + "Centre Name cannot be empty. Please check.");
		
		if(vFormObject.centre_email.value=="")
		user_msg= user_msg + wrap(msgPrefix + "Centre Email cannot be empty. Please check.");
		

		if(vFormObject.contact_address.value=="")
		user_msg= user_msg + wrap(msgPrefix + "Centre Address cannot be empty. Please check.");
	
	}else
	{
	
		if(vFormObject.contact_reg_id.value=="")
		user_msg= user_msg + wrap(msgPrefix + "BKIT Membership Id cannot be empty. Please check.");
		
		if(vFormObject.contact_email.value=="")
		user_msg= user_msg + wrap(msgPrefix + "Email cannot be empty. Please check.");
	

		if(vFormObject.contact_address.value=="")
		user_msg= user_msg + wrap(msgPrefix + "Conaact Address cannot be empty. Please check.");
		
		
	
	}
	
	
		if(vFormObject.contact_name.value=="")
		user_msg= user_msg + wrap(msgPrefix + "Contact Name cannot be empty. Please check.");

		if(vFormObject.contact_mobile.value=="")
		user_msg= user_msg + wrap(msgPrefix + "Mobile no cannot be empty. Please check.");


	if(vFormObject.centre_email.value!="")
	{
	
		if (!emailfilter.test(vFormObject.centre_email.value)){
		
		user_msg = user_msg + wrap("Invalid Email address. Please check.");
		
		}
	}
	if(vFormObject.contact_email.value!="")
	{
	
		if (!emailfilter.test(vFormObject.contact_email.value)){
		
		user_msg = user_msg + wrap("Invalid Email address. Please check.");
		
		}
	}



	if(user_msg=="")
		return true;
	else
	{	alert(user_msg);
		return false;
	}
	
	
	

}
function refreshCaptcha(){

document.getElementById("captchaimg").src="render-captcha.php?" + Math.random();

}

</script>
<?
unset($_SESSION["form-data"]);
?>
<? include("includes/footer.php") ?>